package com.acce.core.pushlets;

import org.apache.log4j.Logger;

import nl.justobjects.pushlet.core.Event;
import nl.justobjects.pushlet.core.EventPullSource;

public class UpdateCarLockPushlet extends EventPullSource {

	Logger log = Logger.getLogger(UpdateCarLockPushlet.class);

	protected long getSleepTime() {
		return 1000;// 每一秒钟自动执行一次
	}

	protected Event pullEvent() {
		// 注意，以下是设定消息的主题/order/buyerlist，号称主题是可以继承的
		Event event = Event.createDataEvent("/wape/updateCarLock");
		String data = "hello,world 郭强 " + System.currentTimeMillis();
		try {
			data = new String(data.getBytes("UTF-8"), "ISO-8859-1");
		} catch (Exception e) {
			e.printStackTrace();
		}
		event.setField("hw", data);
		return event;
	}

}
